import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/layout",
    name: "layout",
    component: () => import("../views/Layout/index.vue"),
    children: [
      {
        //主页
        path: "/",
        name: "home",
        component: () => import("../views/Home/index.vue"),
      },
      {
        //管理员模块
        path: "admin",
        name: "admin",
        component: () => import("../views/Admin/index.vue"),
      },
      {
        //学员模块
        path: "student",
        name: "student",
        component: () => import("../views/Student/index.vue"),
      },
      {
        // 视频模块
        path: "video",
        name: "video",
        component: () => import("../views/Video/index.vue"),
      },
      {
        //课程添加
        path: "courseadd",
        name: "courseadd",
        component: () => import("../views/CourseAdd/index.vue"),
      },
      {
        //课程列表模块
        path: "courselist",
        name: "courselist",
        component: () => import("../views/CourseList/index.vue"),
      },
    ],
  },
  {
    path: "/login",
    name: "login",

    component: () => import("../views/Login/index.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
